package com.Test;

public class Demo {
    public static void main(String[] args) {
        feed(new Animal() {
            @Override
            public void eat() {
                System.out.println("狗吃骨头");
            }

            @Override
            public void sleep() {
                System.out.println("狗在睡觉");
            }
        });
    }

    public static void feed(Animal a){
        a.eat();
    }
}
